package cn.bone.web.config;

import cn.bone.web.interceptor.LoginInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by MD-01 on 2017/4/14.
 */
@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter{



    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new LoginInterceptor())
                .excludePathPatterns("/login","/layui/*")
                .addPathPatterns("/*");
        super.addInterceptors(registry);
    }
}
